package org.lanyu.springainovel.common.event;

import lombok.Getter;
import org.lanyu.springainovel.common.entity.AiMcp;
import org.springframework.context.ApplicationEvent;

/**
 * MCP状态变更事�?
 * <p>
 * 注意：enable和status的区�?
 * <ul>
 * <li>enable：前端用户设置的MCP服务启用/禁用状态（用户控制�?/li>
 * <li>status：MCP服务的实际连接状态（系统根据连接结果设置�?/li>
 * </ul>
 */
@Getter
public class McpStatusChangeEvent extends ApplicationEvent {

    private final String serverName;
    private final boolean enable;
    private final boolean status;
    private final AiMcp mcp;

    /**
     * 创建一个新的MCP状态变更事�?
     * @param source 事件�?
     * @param serverName MCP服务器名�?
     * @param enable 用户设置的启用状态（true=启用，false=禁用�?
     * @param status 实际连接状态（true=连接成功，false=连接失败�?
     * @param mcp MCP实体对象
     */
    public McpStatusChangeEvent(Object source, String serverName, boolean enable, boolean status, AiMcp mcp) {
        super(source);
        this.serverName = serverName;
        this.enable = enable;
        this.status = status;
        this.mcp = mcp;
    }

}
